import React,{useState,useEffect} from 'react'
import '../scss/TheLoanDetails.scss'
import { Radio } from 'antd';
import {
  PrinterOutlined,
  LeftOutlined,
  CheckCircleFilled,
  ClockCircleFilled
} from '@ant-design/icons';
import { Link } from 'react-router-dom';
import { Table } from 'antd'
import Information from './Information'

export default function CollectionRecordDetails(props) {

  const [des,setdes] = useState('')


  useEffect(() => {
    console.log(props.history.location.des);
    sessionStorage.setItem('des',props.history.location.des)
    console.log(props);
  setdes(sessionStorage.getItem('des'))

  },[])

  const back = ()=>{
    if(des == '催收办理'){
      props.history.push('/home/overduto')
      console.log(111);
      sessionStorage.removeItem('des')
    }else if(des == '催收记录详情'){
      props.history.push('/home/collectionrecords')
      console.log(333);
      sessionStorage.removeItem('des')
    }
  }

  return (
    <div className='CollectionRecordDetails'>
        <div className='nav'>
          <span className='title2'>{des}</span>
          <div className='right'>
            <div>
              <span className='top'>初审 <CheckCircleFilled /> </span>
              <span className='top'>复审 <CheckCircleFilled /> </span>
              <span className='top'>终审 <CheckCircleFilled /> </span>
              <span className='top'>放款 <CheckCircleFilled /> </span>
              <span className='top'>还款 <CheckCircleFilled /> </span>
              <span className='top2'>完成 <ClockCircleFilled /> </span>

              <Radio.Button value="large" className='buttonloan'><PrinterOutlined /> 打印</Radio.Button>

              <Radio.Button value="large" className='buttonloan' onClick={back}><LeftOutlined /> 返回</Radio.Button>

            </div>
          </div>
        </div>

        {/* <span className='Clienname'><strong>( 客户【{props.history.location.name}】 )</strong></span> */}

        <Information name={props.history.location.name}/>

        

    </div>
  )
}










